%from datetime import datetime
%from datamodel import Reply

%for i in articles:
  %date = datetime.strptime(str(i.key.id())[:-5], "%Y%m%d%H%M")
<article> <!--article start-->
<header>
  <h1 class="entry-title">
    <a rel="bookmark" href="/id/{{i.key.id()}}" title="{{i.title}}">{{i.title}}</a>
  </h1>
  <p class="meta">
    <time datetime="{{date.strftime('%Y-%m-%dT%H:%M:%SZ')}}" pubdate data-updated="true"> {{date.strftime('%b')}}
      {{"%s%s"%(date.day, 'trnshddt'[0xc0006c000000006c>>2*date.day&3::4])}}, {{date.year}}</time> &bull;
    {{', '.join(i.categories)}} &bull; tags: {{', '.join(i.tags)}} &bull; {{i.language}} &bull;
    {{!'%s only &bull; '%i.purview if i.purview != 'anonymous' else ''}}{{i.counter}} hits,
    {{Reply.query(ancestor=i.key).count()}} reply
  </p>
</header>
<summary>
{{!i.summary}}
</summary>
<br>
</article> <!--article stop-->
%end

<div class="pagination">
  <a class="prev" href="?">&uarr; First</a>
%for i in month_list:
  <a href="?date={{i[0][0]}}.{{i[0][1]}}~{{i[1][0]}}.{{i[1][1]}}" {{!'style="color:#222"' if i[2] else ''}}
  %if i[0][1] != i[1][1]:
    title="{{i[0][0]}}.{{i[0][1]}}~{{i[1][0]}}.{{i[1][1]}}">{{i[0][1]}}~{{i[1][1]}}
  %else:
    title="{{i[0][0]}}.{{i[0][1]}}">{{i[0][1]}}
  %end
  </a>
%end
  <a class="next" href="?date={{month_list[-1][1][0]}}.{{month_list[-1][1][1]}}">Last &darr;</a>
</div>

%rebase templates/layout_main sidebar=sidebar
